Skip to content

fix(spec-sync): disable adaptive thinking so the LLM PR summary lands - #139

Merged
tian-lan-landing merged 1 commit into
mainfrom
fix/spec-sync-summary-adaptive-thinking
Aug 3, 2026
Merged

fix(spec-sync): disable adaptive thinking so the LLM PR summary lands#139
tian-lan-landing merged 1 commit into
mainfrom
fix/spec-sync-summary-adaptive-thinking

Conversation

@tian-lan-landing

Copy link
Copy Markdown
Collaborator

The spec-sync ## What changed summary runs the same fragile code that dropped the summary on ade-typescript #102/#103 (No summary produced; keeping the static PR body.). It has not tripped here yet, but it is the identical bug and will on some future diff.

Root cause: claude-sonnet-5 runs adaptive thinking when the thinking field is unset. The thinking tokens count against max_tokens, and the first content block is a thinking block — so .content[0].text came back empty, which the script could not distinguish from "no summary".

Fix (mirrors ade-typescript#104):

  • thinking: {type: "disabled"} — no reasoning pass, so the whole max_tokens budget goes to text and the first block is text.
  • Join all text blocks ([.content[]? | select(.type=="text") | .text] | join("")) instead of indexing [0].
  • Bump max_tokens 700 → 1000.
  • Log the response shape (error type/message, stop_reason, block types) on empty, so the next failure is diagnosable.

claude-sonnet-5 runs adaptive thinking when `thinking` is unset. The
thinking tokens count against max_tokens and the first content block is
a thinking block, so `.content[0].text` came back empty and the
"What changed" section was silently dropped. Same failure as the
TypeScript side (PR #102, #103); this one just hadn't tripped yet.

Turn thinking off, join all text blocks instead of indexing [0], bump
the cap 700 -> 1000, and log the response shape on empty.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 3, 2026 10:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes unreliable spec-sync PR summaries by disabling adaptive thinking and improving response parsing and diagnostics.

Changes:

  • Disables adaptive thinking and increases output budget.
  • Joins all text response blocks.
  • Adds failure diagnostics.

Comment on lines +60 to +62
printf '%s' "$response" \
| jq -c '{error_type: .error?.type, error_message: .error?.message, stop_reason, block_types: [.content[]?.type]}' \
2>/dev/null || echo "response was empty or not JSON (curl failed?)"
@tian-lan-landing
tian-lan-landing merged commit f16b868 into main Aug 3, 2026
5 of 6 checks passed
@tian-lan-landing
tian-lan-landing deleted the fix/spec-sync-summary-adaptive-thinking branch August 5, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants